import Koa from "koa";
import Static from "./plugins/Static.js";
import ReadPathPlugin from "./plugins/ReadPath.js";
import ResolveVueModule from "./plugins/ResolveVueModule.js";
import CompilerSFC from "./plugins/CompilerSFC.js";
import UpdateStyles from "./plugins/UpdateStyles.js";
import InjectScript from "./plugins/InjectScript.js";
const app = new Koa();

/**
 * 参数
 *  app 对象
 *  root 根路径
 */
const root = process.cwd();
const context = {
  app,
  root,
};
/**
 *
 */
const plugins = [
  ReadPathPlugin,
  ResolveVueModule,
  CompilerSFC,
  UpdateStyles,
  InjectScript,
  Static,
];

plugins.forEach((plugin) => plugin(context));

app.listen(5173, () => {
  console.log("http://localhost:5173");
});
